package com.gjy.nacos.server.controller;

import com.gjy.nacos.server.config.NacosServerYaml;
import com.gjy.nacos.server.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-03-07 21:28:17
 */
@RestController
@RequestMapping("/nacos/server")
public class NacosServerController {

    @Resource
    private NacosServerYaml nacosServerYaml;
    @Value("${redis.version}")
    private String v2;

    @GetMapping("/version")
    public AjaxResult getVersion() {
        String version = nacosServerYaml.getVersion();
        return AjaxResult.builder().data(version + ":" + v2).build();
    }

}
